package productorconsumidor;

import java.util.logging.Level;
import java.util.logging.Logger;

public class ProductorConsumidor {
    public static void main(String[] args) throws InterruptedException {
        Mesa m = new Mesa();
        Productor p = new Productor();
        Consumidor c = new Consumidor();
        p.setLaMesa(m);
        c.setLaMesa(m);
        

        
        new Thread(c).start();
        new Thread(p).start();      
        Thread.sleep(1000);
        synchronized(m){
            try {
               Object o = new Object();
               synchronized(o){
                   o.wait(3000);
               }               
            } catch (InterruptedException ex) {
                Logger.getLogger(ProductorConsumidor.class.getName()).log(Level.SEVERE, null, ex);
            }
        }        
    }
}
